<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>紀錄抵達旅館時間</title>
    </head>
    <body>
        <div class="body">
            <h1>紀錄抵達旅館時間(目前有${allCount}位運動員正在前往旅館的路上)</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            
            <table><tr>
            <td>
            <g:form method="post">
			   	<g:hiddenField name="searchType" value="uid" />
				<g:textField name="searchKey" />
			   	<g:actionSubmit action="hotel" value="依照認證號碼撈"/>
			</g:form>   
			<g:form method="post">
				<g:hiddenField name="searchType" value="name" />
				<g:textField name="searchKey" />
			   	<g:actionSubmit action="hotel" value="依照姓名撈"/>
			</g:form>  
			</td><td>
			<g:form method="post">
				<g:hiddenField name="searchType" value="nation" />
				<g:select name="searchKey" from="${Nation.list()}" optionKey="id" optionValue="name"/>
			   	<g:actionSubmit action="hotel" value="依照國別撈"/>
			</g:form>   
			<g:form method="post">
				<g:hiddenField name="searchType" value="sport" />
				<g:select name="searchKey" from="${Sport.list()}" optionKey="id" optionValue="name"/>
			   	<g:actionSubmit action="hotel" value="依照運動項目撈"/>
			</g:form>  
			</td>
			</tr></table>
			<hr />  
             
             <table>
             <tr>
             	<td>認證號碼</td>
             	<td>姓名</td>
             	<td>國別</td>
            	<td>性別</td>
            	<td>運動項目</td>
            	<td>實際抵達認證中心時間</td>
             	<td>預計抵達旅館時間</td>
             	<td></td>
             </tr>
             <g:each var="person" in="${people}">
			 	<tr class="mouseOver">
			 		<td>${person.uid}</td>
			 		<td><g:link controller="sportsman" action="show" id="${person.id}">${person.name}</g:link></td>
			 		<td>${person.nation?.name}</td>
					<td>${person.sex}</td>
					<td>${person.sport?.name}</td>
					<td><g:formatDate format="MM-dd HH:mm" date="${person.centerComeAt}" /></td>
			 		<td><g:formatDate format="MM-dd HH:mm" date="${person.predictHotelComeAt}" /></td>
			 		<td>
			 			<g:link action="hotel" params="[actionType:'submit', personId:person.id, searchType:searchType, searchKey:searchKey]">確定抵達</g:link>
			 			<g:link action="hotel" params="[actionType:'delete', personId:person.id, searchType:searchType, searchKey:searchKey]">移除紀錄</g:link>
			 		</td>
			 	</tr>
             </g:each>
             </table>

        </div>
    </body>
</html>
